<!-- 创新宣传ksList.jsp -->
<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="frm.ssh.util.page.SearchBean"%>
<%@ include file="/jsp/common/common.jsp"%>

<html>
	<head>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script type="text/javascript" src="<%=contextPath%>/ext3/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/ext3/ext-all.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<link rel="stylesheet" type="text/css"	href="<%=contextPath%>/ext3/resources/css/ext-all.css">
		<script>
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				        {
				            text: '查询',
				            icon:"<%=contextPath%>/images/query.gif",
				            handler:cmt
				        },'-',
				        {
				            text: '增加',
				            icon:"<%=contextPath%>/images/add.gif",
				            handler:function(){
				            	toDetail('0')				            	
				            },
				            hidden:<%=session.getAttribute("btn_add_display") != null || "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        },'-',
				        {
				            text: '删除',
				            icon:"<%=contextPath%>/images/delete.gif",
				            handler:deleteIt,
				            hidden:<%=session.getAttribute("btn_delete_display") != null || "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>
				        },'-',
				        {
				            text: '清空',
				            icon:"<%=contextPath%>/images/clear.png",
				            handler:resetForm
				        },'->',
				        {
				            text: '查询条件',
				            icon:"<%=contextPath%>/images/down_bottom.gif",
				            handler:displayquerydiv
				        }
			    	]
			    });
			});
		</script>
	</head>
	<body>
		<div id ='tbar'></div>
		<br>
		<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
		
		<form id="frmM" name="frmM" method="POST" action="<%=contextPath%>/queryUser.do">
			<s:hidden name="searchBean.displayFlag" />		
			<table width="100%" id="contab">
				<tbody id="querydiv">
				<tr>
					<th>
						<c:if test="${searchBean.con1 == '0'}">
						宣传时间
					    </c:if>
					    <c:if test="${searchBean.con1 == '1'}">
						创新时间
					    </c:if>
					</th>
					<td>
						<input type="text" size="12" readonly="true" name="searchBean.con2"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" id="searchBean.con2" value="${searchBean.con2}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con2')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
						&nbsp;
						~
						&nbsp;
						<input type="text" size="12" readonly="true" name="searchBean.con3"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" id="searchBean.con3" value="${searchBean.con3}"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('searchBean.con3')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
				</tr>
				</tbody>
			</table>
			
			<hr>
			<table width="100%" id="listtab">
				<tr>
					<th   width="25">
						<input name="chkAll" type="checkbox" id="chkAll"
							onclick="javascript:checkAll(this.form, 'id');" value="checkbox">
					</th>
					<th   width="120"><c:if test="${searchBean.con1 == '0'}">
						宣传开始时间
					    </c:if>
					    <c:if test="${searchBean.con1 == '1'}">
						创新开始时间
					    </c:if></th>
					<th   width="120"><c:if test="${searchBean.con1 == '0'}">
						宣传结束时间
					    </c:if>
					    <c:if test="${searchBean.con1 == '1'}">
						创新结束时间
					    </c:if></th>
					<th   width="200">地点</th>
					<th   width="150">记录人</th>
					<th   width="200">计划</th>
					<th   >内容</th>

				</tr>
				<c:forEach items="${list}" var="detail" >
					<tr>
						<td  width="25">
							<input type="checkbox" name="id" value="${detail.id}" />
						</td>
						<td width="120" >
								<a href="#" onClick="javascript:toDetail('<c:out value="${detail.id}"/>')" >
									<fmt:formatDate value="${detail.kssj}" pattern="yyyy-MM-dd HH:mm"/>
								</a>
						</td>
						<td width="120">&nbsp;<fmt:formatDate value="${detail.jssj}" pattern="yyyy-MM-dd HH:mm"/></td>
						<td width="200">
							&nbsp;<c:out value="${detail.ksdd}"/>
						</td>
						<td width="150">
							&nbsp;<c:out value="${detail.pxy}"/>
						</td>
						<td width="200" >
							&nbsp;<c:out value="${detail.pxjh}"/>
						</td>
						<td>
							&nbsp;<c:out value="${detail.pxnr}"/>
						</td>

					</tr>
				</c:forEach>
				<c:if test="${list == null || fn:length(list) == 0 }">
					<tr>
						<td colspan="7" style="text-align: center">
							无相关记录
						</td>
					</tr>
				</c:if>
			</table>
			<table width="100%" id="tablestyle2">
				<tr>
					<td>
						<hr />
					</td>
				</tr>
				<tr>
					<td>${pageDown}</td>
				</tr>
			</table>
		</form>
		</div>
	</body>
</html>
<script language="javascript">

			// 查询
			function cmt(){
				document.frmM.action = "<%=contextPath%>/cxxcList!getList.do?page=1&c=c";
				document.frmM.submit();
			}

			// 新建修改进入详细页面
			function toDetail(id){
				document.frmM.action = "<%=contextPath%>/cxxc!initDetail.do?id=" + id;
				uncheck("id");
				document.frmM.submit();
			}

			// 删除
			function deleteIt()
			{
				if(!isChecked("id")) {
		 			alert("请选择要删除的记录");
		 			return false;
		 		}
		    	if(confirm("确定要删除选中的记录吗？")) {
		        	document.frmM.action = "<%=contextPath%>/cxxc!delete.do";
					document.frmM.submit();
		    	}
			}
			
		</script>